package com.moxiao.yfjh.module.system.sms.utils;

import com.moxiao.yfjh.module.system.sms.client.SmsApi;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @version 1.0
 * @Author zhk
 * @Date 2023/11/10 14:03
 **/
@Component
public class SmsUtils {
    private static SmsApi smsApi;
    @Autowired
    public void setTodayReaderService(SmsApi smsApi) {
        SmsUtils.smsApi = smsApi;
    }
    /**
     * 发送短信
     *
     * @param mobile
     * @param text
     * @return
     */
    public JSONObject sendSms(String mobile, String text){
        return JSONObject.parseObject(smsApi.singleSend(mobile, text));
    }
}
